#ifndef FTTABWIDGET_H
#define FTTABWIDGET_H

#include <QtGui>
#include "rotatingwidget.h"

class FTPushButton;
class FTPushButtonIcon;

class FTTabWidget : public RotatingWidget
{
    Q_OBJECT
public:
    enum fttabwidget_mode { full_page, with_header };

    explicit FTTabWidget(fttabwidget_mode m = full_page);
    ~FTTabWidget();


    void addTab( QWidget*, const QString& );
    void addTab( QWidget*, const QIcon&, FTControls::IconSize s = FTControls::IconNormal );

    void addExtra( QWidget* );
    void setCurrentWidget( QWidget* );
    void showIndex();
    QWidget* currentWidget();

signals:
    void currentChanged();

public slots:

private slots:
    void selectTab();
    void indexTab();

private:
    fttabwidget_mode _mode;
    QStackedWidget* panels;
    QWidget* index_tab;
    FTPushButton* back_button;

    QButtonGroup buttons_group;
    QHash<QAbstractButton*, QWidget*> bindings;
    QList<QAbstractButton*> buttons;
    QList<QWidget*> extra_widgets;

    void appendTab( QWidget*, QAbstractButton* );

protected:
    virtual QLayout* createHorizontal();
    virtual QLayout* createVertical();
};

#endif // FTTABWIDGET_H
